package notifier.view.menus;

import javax.swing.*;
import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * User: Nuno Rafael Figueiredo
 * Date: 10-02-2014
 * Time: 18:49
 */
public class ExitItem extends JMenuItem {
    /**
     *
     */
    private static final long serialVersionUID = 1166324617220010176L;

    public ExitItem(final SystemTray tray, final TrayIcon trayIcon) throws HeadlessException {
        super("Exit");
        addActionListener(e -> {
            tray.remove(trayIcon);
            System.exit(0);
        });
    }
}
